<% include header %>
<h1 class="articleTitle"><%=title%> <a href="news">添加新闻</a></h1>
<table class="table">
    <thead>
        <tr>
            <th>标题</th>
            <th>添加时间</th>
            <th>更新时间</th>
            <th>是否为转载</th>
            <th>tags</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <% if(data&&data.length>0) { for(var i=0;i<data.length;i++){%>
        <tr>
            <td><a href="news/<%=data[i]._id%>"><%=data[i].title%></a></td>
            <td><%=data[i].meta.creatAt%></td>
            <td><%=data[i].meta.updateAt%></td>
            <%if(data[i].reprint_source){%>
                <td>转载</td>
            <%}else{%>
                <td>原创</td>
            <%}%>
            <td><%=data[i].tags%></td>
            <td><a href="news/<%=data[i]._id%>">编辑</a> | <a href="news/delete/<%=data[i]._id%>">删除</a></td>
        </tr>
        <%}  } else{%>
        <tr>
            <td>没有数据嘞！</td>
        </tr>
        <%}%>
    </tbody>
</table>
<% include footer %>